import {messages} from "share/common";

export function validation(params) {
  return new Promise((resolve, reject) => {
    let errorMessages = [];
    if((params.paymentScheduleType === 1002 && params.planedPaymentDate <= 0) ||
      (params.paymentScheduleType === 1003 && params.amount <= 0)) {
      errorMessages.push(messages('finance-9.key20')/*支付金额必须大于0*/)
    }
    errorMessages.length && reject(errorMessages);
    resolve();
  })

}
